package com.zxd.socket.service;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * ClassName:Service
 * Package:com.zxd.socket.service
 *
 * @Date:2023/10/6 17:25
 * @Author:zxde
 */
public class Service {
    public static void main(String[] args) throws Exception {
        //创建服务端socket
        ServerSocket serviceHost = new ServerSocket(6666);
        //接受客户端的请求封装成socket对象
        while (true) {
            Socket accept = serviceHost.accept();
            new Thread(new Target(accept)).start();
        }
    }
}
